<?php

include $_SERVER['DOCUMENT_ROOT']."/lib/start.php";

check_session();
check_permission(ADM_PERM);

header("Content-type: text/plain");

$uname = $_POST['nick'];
$pwd = $_POST['pwd'];

$update = "UPDATE genitori SET username = '$uname', password = '$pwd' WHERE id_genitore = ".$_REQUEST['id'];
try{
	$result = $db->executeUpdate($update);
} catch (MySQLException $ex){
	$er = "ko;".$ex->getQuery().";".$ex->getMessage();
	print $er;
	exit;
}

print "ok";
exit;

?>